<template>
    <el-header class="header">
        <div class="logo">人力资源管理系统</div>
        <el-menu mode="horizontal" class="menu">
            <el-menu-item index="1">设置</el-menu-item>
            <el-menu-item index="2" @click="quitSystem">退出</el-menu-item>
        </el-menu>
    </el-header>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import { getData } from "../../../api/api"
const router = useRouter()

const quitSystem = async () => {
    const res = await getData("/quit")
    if (res.code != 200) return
    router.push("/welcome")
}

</script>

<style scoped lang="scss">
.header {
    background-color: #fff;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

.menu {
    line-height: 60px;
}
</style>